<template>
	<view class="tab-content">
		<view
			class="top-bar flexr align-center"
			:style="{
				'height': `${sysStore.navBarHeight}px`,
				'paddingTop': `${sysStore.statusBarHeight}px`,
			}"
		>
			<view class="top-bar-item flexr align-center">
				<text>售后服务</text>
			</view>
		</view>
		<view class="divider"></view>
		<view class="content flex-1 flexc">
			<view class="flexr justify-center">
				<view class="after-sale-service" @click="goService">
					<image class="icon" src="@/static/service.png"></image>
					<text class="service-text">客服咨询</text>
				</view>
				<view class="after-sale-service" @click="goMaintain">
					<image class="icon" src="@/static/maintain.png"></image>
					<text class="service-text">预约维修</text>
				</view>
			</view>
			<view class="section flexr align-center">
				<view class="header"></view>
				<view class="title">热点问题</view>
			</view>
			<view class="divider"></view>
			<view class="scroll-view">
				<view class="question" v-for="(item, index) in 50" :key="index" @click="goQuestionDetail">
					戴前须知！镜片佩戴及护理指南
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import { useSysStore } from '@/store/sys.js';
import { ref } from 'vue';
const sysStore = useSysStore()
function goQuestionDetail() {
	uni.navigateTo({
		url: `/subpages/afterSale/questionDetail?title=配送常见问题`
	})
}
function goMaintain() {
	uni.navigateTo({
		url: "/sub/maintain"
	})
}
function goService() {
	uni.navigateTo({
		url: "/subpages/afterSale/myService"
	})
}
</script>

<style lang="scss">
.tab-content {
	background-color: white;
	.content {
		padding: 32rpx;
	}
	.top-bar {
		flex-shrink: 0;
		box-sizing: border-box;
		padding: 0 20rpx;
		background-color: white;
		.top-bar-item {
			align-self: stretch;
			font-size: 35rpx;
			// padding: 0 20rpx;
			color: $text-color1;
		}
	}
	.after-sale-service {
		height: 122rpx;
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background-color: $primary-color;
		border-radius: 12rpx;
		// margin-left: 32rpx;
		.icon {
			width: 40rpx;
			height: 40rpx;
		}
		.service-text {
			color: white;
			margin-top: 10rpx;
		}
	}
	.after-sale-service + .after-sale-service {
		background-color: rgba(240, 131, 0, 1);
		margin-left: 18rpx;
		// margin-right: 32rpx;
	}
	.section {
		margin-top: 45rpx;
		margin-bottom: 32rpx;
	}
	.header {
		width: 8rpx;
		border-radius: 4rpx;
		height: 32rpx;
		background-color: $primary-color;
	}
	.title {
		font-size: 32rpx;
		color: $text-color1;
		margin-left: 16rpx;
	}
	.scroll-view {
		flex: 1;
		overflow-y: scroll;
	}
	.question {
		font-size: 28rpx;
		color: $text-color2;
		padding: 30rpx 0;
	}
}
</style>
